#ifndef _TIMER_16_BIT_H_
#define _TIMER_16_BIT_H_

	enum CompareOutputModeTimer16Bit
	{
		NormalPortOperation_OC1A_DisconnectTimer16,
		Toggle_OC1A_onCompareTimer16,
		Clear_OC1A_onCompareTimer16,
		Set_OC1A_onCompareTimer16,
		NormalPortOperation_OC1B_DisconnectTimer16,
		Toggle_OC1B_onCompareTimer16,
		Clear_OC1B_onCompareTimer16,
		Set_OC1B_onCompareTimer16
	
	};


	enum WaveformGenerationModeTimer16Bit
	{
		NormalWaveformGenerationTimer16,
		PWM_PhaseCorrect_8Bit_Timer16,
		PWM_PhaseCorrect_9Bit_Timer16,
		PWM_PhaseCorrect_10Bit_Timer16,
		CTC_Timer16,
		FastPWM_8Bit_Timer16,
		FastPWM_9Bit_Timer16,
		FastPWM_10Bit_Timer16,
		PWM_PhaseAndFrequencyCorrect1_Timer16,
		PWM_PhaseAndFrequencyCorrect2_Timer16,
		PWM_PhaseCorrect1_Timer16,
		PWM_PhaseCorrect2_Timer16,
		CTC_ICR1_2_TImer16,
		Reserved_Timer16,
		FastPWM_1_Timer16,
		FastPWM_2_Timer16
	};


	enum ClockSelectTimer16
	{
		NoClockSourceTimer16,
		NoPrescaler_Timer16,
		Prescaler8_Timer16,
		Prescaler64_Timer16,
		Prescaler256_Timer16,
		Prescaler1024_Timer16,
		ExternalClockFalling,
		ExternalClockRising
	};

class Timer16Bit
{
	public:
	unsigned long int getFrequencyCTC(
						unsigned long int CLK_IO,
						unsigned long int prescaler,
						unsigned long int OCR_Value
						);

	unsigned long int getFrequencyFastPWM(
					unsigned long int CLK_IO,
					unsigned long int prescaler,
					unsigned long int TOP
					);

	unsigned long int getFrequencyPhaseCorrectPWM(
					unsigned long int CLK_IO,
					unsigned long int prescaler,
					unsigned long int TOP
					);

	unsigned long int getFrequencyPhaseFrequencyCorrectPWM(
				unsigned long int  CLK_IO,
				unsigned long int prescaler,
				unsigned long int TOP
				);

	void setCompareUnitAOutputMode(unsigned char flag);

	void setCompareUnitBOutputMode(unsigned char flag);

	void setForceOutputCompareA(unsigned char flag);
	void setForceOutputCompareB(unsigned char flag);

	void setWaveformGenerationMode(unsigned char flag);

	void setInputCaptureNoiseCanceler(unsigned char flag);

	void setInputCaptureEdgeSelect(unsigned char flag);

	void setClockSelect(unsigned char flag);

	void setTimerCounterTimer1(unsigned long int flag);

	unsigned long int getTimerCounter1();

	void setOutputCompare1A(unsigned long int flag);

	unsigned long int getOutputCompare1A();

	void setOutputCompare1B(unsigned long int flag);

	unsigned long int getOutputCompare1B();

	void setInputCapture(unsigned long int flag);

	unsigned long int getInputCapture();

	void setInputCaptureInterruptEnable(unsigned char flag);

	void setOutputCompareAInterruptEnable(unsigned char flag);

	void setOutputCompareBInterruptEnable(unsigned char flag);

	void setTimerOverflowInterruptEnable(unsigned char flag);

	unsigned char getInputCaptureFlag();

	unsigned char getOutputCompareAFlag();

	unsigned char getOutputCompareBFlag();

	unsigned char getTimerOverflowFlag();

};






#endif
